\defmodule{LMScrambleShift}

This class implements a
\externalclass{umontreal.iro.lecuyer.hups}{PointSetRandomization}
that performs a left matrix scrambling and adds a random digital
shift. Point set must be a
\externalclass{umontreal.iro.lecuyer.hups}{DigitalNet} or an
\externalclass{java.lang}{IllegalArgumentException} is thrown.

\bigskip\hrule\bigskip
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{code}
\begin{hide}
/*
 * Class:        LMScrambleShift
 * Description:  performs a left matrix scramble and adds a random digital shift
 * Environment:  Java
 * Software:     SSJ 
 * Copyright (C) 2001  Pierre L'Ecuyer and Universite de Montreal
 * Organization: DIRO, Universite de Montreal
 * @author       
 * @since

 * SSJ is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License (GPL) as published by the
 * Free Software Foundation, either version 3 of the License, or
 * any later version.

 * SSJ is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * A copy of the GNU General Public License is available at
   <a href="http://www.gnu.org/licenses">GPL licence site</a>.
 */
\end{hide}
package umontreal.iro.lecuyer.hups;
\begin{hide}
 import umontreal.iro.lecuyer.rng.RandomStream;
 import java.lang.IllegalArgumentException;
\end{hide}

public class LMScrambleShift extends RandomShift \begin{hide} {
\end{hide}
\end{code}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection*{Constructors}
\begin{code}

   public LMScrambleShift() \begin{hide} {
   }
   \end{hide}
\end{code}
\begin{tabb}
   Empty constructor.
\end{tabb}
\begin{code}

   public LMScrambleShift (RandomStream stream) \begin{hide} {
       super(stream);
   }
   \end{hide}
\end{code}
\begin{tabb}
   Sets internal variable \texttt{stream} to the given
   \texttt{stream}.
\end{tabb}
\begin{htmlonly}
   \param{stream}{stream to use in the randomization}
\end{htmlonly}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection*{Methods}
\begin{code}

   public void randomize (PointSet p) \begin{hide} {
      if (p instanceof DigitalNet) {
         ((DigitalNet)p).leftMatrixScramble (stream);
         ((DigitalNet)p).addRandomShift (stream);
      } else {
         throw new IllegalArgumentException("LMScrambleShift"+
                                            " can only randomize a DigitalNet");
      }
   }
   \end{hide}
\end{code}
\begin{tabb}
   This method calls
   \externalmethod{umontreal.iro.lecuyer.hups}{DigitalNet}{leftMatrixScramble}{RandomStream},
   then
   \externalmethod{umontreal.iro.lecuyer.hups}{DigitalNet}{addRandomShift}{RandomStream}.
   If \texttt{p} is not a
   \externalclass{umontreal.iro.lecuyer.hups}{DigitalNet}, an
\externalclass{java.lang}{IllegalArgumentException} is thrown.
\end{tabb}
\begin{htmlonly}
   \param{p}{Point set to randomize}
\end{htmlonly}
\begin{code}\begin{hide}
}
\end{hide}\end{code}
